<?php
namespace app\admin\validate;

use think\Validate;

class Admin extends Validate
{
    protected $rule =   [
        'name'  => 'require|max:10|unique:admin',
        'password'   => 'require|min:6',
            
    ];

    protected $message  =   [
        'name.require' => '管理员名称不得为空！',        
        'name.max'     => '管理员名称最多不能超过10个字符',
        'name.unique'  => '管理员名称不得重复！', 

        'password.require' => '管理员密码不得为空！',
        'password.min' => '管理员密码最少6位！',

        
          
    ];

    protected $scene = [
        'edit'  =>  ['name'],
        'add' =>['name','password'],
    ];

}